package com.naiterui.ehp.bs.cms.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.naiterui.ehp.bs.cms.common.vo.PageParamsVO;
import com.naiterui.ehp.bs.cms.common.vo.PageVO;
import com.naiterui.ehp.bs.cms.modules.sys.entity.Log;
import com.naiterui.ehp.bs.cms.modules.sys.mapper.LogMapper;
import com.naiterui.ehp.bs.cms.modules.sys.service.ILogService;
import com.naiterui.ehp.bs.cms.modules.sys.vo.LogVO;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements ILogService {

  @Override
  public PageVO<Log> queryPage(PageParamsVO pageParamsVO, Log log) {
    IPage<Log> page = this.page(pageParamsVO.getPage(), pageParamsVO.getEntityWrapper(log));
    return PageVO.toPageVo(page);
  }

  @Override
  public PageVO<LogVO> queryUserLogPage(PageParamsVO pageParamsVO) {

    return null;
  }

  @Async
  @Override
  public void saveLog(Log entity) {
    super.save(entity);
  }
}
